ostree.git
10 years agodeploy: Drop fsync of modified config files
Colin Walters [Sun, 19 Apr 2015 16:34:01 +0000 (12:34 -0400)]
deploy: Drop fsync of modified config files

These fsyncs were added for what turned out to be a fairly bogus
reason; I was hitting read errors from extlinux after upgrades and out
of conservatisim tried adding fsync calls, but the *actual* problem
was that extlinux didn't support 64 bit ext4.  Now that at least for
Project Atomic hosts we're just targeting grub2, we can drop these
fsync calls and rely on `syncfs()` being both faster and catching any
errors.

10 years agodeploy: Use syncfs() in addition to sync()
Colin Walters [Tue, 14 Apr 2015 17:47:08 +0000 (13:47 -0400)]
deploy: Use syncfs() in addition to sync()

For some sort of crazy reason, the `sync()` system call doesn't
actually return an error code, even though from what I can tell in the
kernel it wouldn't be terribly hard to add.

Regardless though, it is better for userspace apps to use `syncfs()`
to avoid flushing filesystems unrelated to what they want to sync.  In
the case of OSTree, this does matter - for example you might have a
network mount point backing your database, and we don't want to block
upgrades on syncing it.

This change is safe because we're doing syncfs in *addition* to the
previous global `sync()` (a revision from an earlier patch).

Now because OSTree only touches the `/` mount point which covers the
repository, the deployment roots (including their copy of `/etc`), as
well as `/boot`, we should at some point later be able to drop the
`sync()` call.  Note that on initial system installs we do relabel
`/var` but that shouldn't happen at ostree time - any new directories
are taken care of via `systemd-tmpfiles` on boot.

10 years agostatus: Don't crash if we deployed a local refspec
Colin Walters [Tue, 21 Apr 2015 01:02:25 +0000 (21:02 -0400)]
status: Don't crash if we deployed a local refspec

In the case we built a local tree, we'd pass `NULL` as a remote down
to the GPG checking code.  Noticed this in the test suite.

10 years agosysroot: Close sysroot fd in finalize
Colin Walters [Sun, 19 Apr 2015 19:25:05 +0000 (15:25 -0400)]
sysroot: Close sysroot fd in finalize

Just noticed this while I was going to add another one there.

10 years agolibglnx: Update from master
Colin Walters [Fri, 17 Apr 2015 20:15:55 +0000 (16:15 -0400)]
libglnx: Update from master

No real changes, but I'd like to use some of the new APIs later.

10 years agoRelease 2015.6
Colin Walters [Fri, 17 Apr 2015 18:16:08 +0000 (14:16 -0400)]
Release 2015.6

10 years agosysroot: Add ostree_sysroot_get_fd()
Colin Walters [Fri, 17 Apr 2015 13:13:31 +0000 (09:13 -0400)]
sysroot: Add ostree_sysroot_get_fd()

This way external programs like rpm-ostree can do fd-relative
operations on the deployment directories, like inspecting the RPM
database.

Closes: https://github.com/GNOME/ostree/pull/91
10 years agomain: Tweak GPG output to match rpm-ostree
Matthew Barnes [Fri, 17 Apr 2015 16:43:46 +0000 (12:43 -0400)]
main: Tweak GPG output to match rpm-ostree

10 years agosysroot: Cache an OstreeRepo instance
Matthew Barnes [Fri, 17 Apr 2015 13:00:17 +0000 (09:00 -0400)]
sysroot: Cache an OstreeRepo instance

Rather than returning a new OstreeRepo instance in each call to
ostree_sysroot_get_repo(), cache one internally so the same instance
is returned each time.

10 years agoadmin: Conditionally show GPG signatures in status command
Matthew Barnes [Wed, 15 Apr 2015 19:04:53 +0000 (15:04 -0400)]
admin: Conditionally show GPG signatures in status command

Only if GPG verification is enabled for a deployment's origin.

10 years agorepo: Add ostree_repo_remote_get_gpg_verify()
Matthew Barnes [Wed, 15 Apr 2015 18:14:55 +0000 (14:14 -0400)]
repo: Add ostree_repo_remote_get_gpg_verify()

Trivial function, but it does at least centralize the default value.

10 years agopull: Print GPG signature status as soon as its known
Matthew Barnes [Tue, 14 Apr 2015 00:26:21 +0000 (20:26 -0400)]
pull: Print GPG signature status as soon as its known

10 years agorepo: Add a "gpg-verify-result" signal
Matthew Barnes [Mon, 13 Apr 2015 17:21:17 +0000 (13:21 -0400)]
repo: Add a "gpg-verify-result" signal

Emitted during a pull operation upon GPG verification (if enabled).
Applications can connect to this signal to output the verification
results if desired.

10 years agorepo: Improve error handling in sign_data()
Matthew Barnes [Wed, 8 Apr 2015 18:50:55 +0000 (14:50 -0400)]
repo: Improve error handling in sign_data()

Use _ostree_gpg_error_to_gio_error() so the actual GPG error message is
included in the GError.  Then apply an "Unable to blah: " message prefix.

10 years agoreset: Don't enforce parent commits
Colin Walters [Wed, 8 Apr 2015 00:54:37 +0000 (20:54 -0400)]
reset: Don't enforce parent commits

First, git doesn't do this, and whatever Linus thinks is right or
something.

Second specifically to OSTree, it's quite common to not have
intermediate commits.  If one wants to reset a ref in order to prune
data after a deployment, the parentage check will fail.

Closes: https://github.com/GNOME/ostree/pull/87
10 years agolibglnx: Update to latest
Colin Walters [Tue, 14 Apr 2015 19:53:51 +0000 (15:53 -0400)]
libglnx: Update to latest

This pulls in more fixes for writes.

10 years agoconfig: add new parameter "commit-update-summary" to core section
Giuseppe Scrivano [Thu, 2 Apr 2015 10:33:07 +0000 (12:33 +0200)]
config: add new parameter "commit-update-summary" to core section

When set to true, the summary file is automatically updated after
a commit.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosummary: write the contents to a temporary file
Giuseppe Scrivano [Thu, 2 Apr 2015 09:58:16 +0000 (11:58 +0200)]
summary: write the contents to a temporary file

do not write directly to the summary file but use a temporary file
first.  It avoids to create an empty file if "ot_util_variant_save"
fails.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years ago_ostree_repo_file_replace_contents: make buf const
Giuseppe Scrivano [Tue, 14 Apr 2015 07:56:13 +0000 (09:56 +0200)]
_ostree_repo_file_replace_contents: make buf const

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: Fix root uid check in test-commit-sign.sh
Matthew Barnes [Tue, 14 Apr 2015 12:53:48 +0000 (08:53 -0400)]
tests: Fix root uid check in test-commit-sign.sh

10 years agolibglnx: Pick up file permission regression fix
Matthew Barnes [Tue, 14 Apr 2015 12:49:18 +0000 (08:49 -0400)]
libglnx: Pick up file permission regression fix

https://bugzilla.gnome.org/747813

10 years agorepo: Add a private helper to replace a file, honoring fsync policy
Colin Walters [Mon, 13 Apr 2015 17:28:02 +0000 (13:28 -0400)]
repo: Add a private helper to replace a file, honoring fsync policy

Extracted from discussion in https://github.com/GNOME/ostree/pull/83

10 years agorefs: Use *at for writes, honor repo fsync flag
Colin Walters [Thu, 9 Apr 2015 01:54:28 +0000 (21:54 -0400)]
refs: Use *at for writes, honor repo fsync flag

I was looking at https://bugzilla.gnome.org/show_bug.cgi?id=738954
which wants us to ensure we chown() the refs.  As part of that,
I did a generic conversion to use `*at()` (which naturally gives
us more low level control so we can call `fchown` etc.

This patch also sneaks in a change to respect the repo's
`disable_fsync` flag - if fsync is not set, then we never
`fdatasync()` (unlike the `g_file_replace_contents()` default.  Also
unlike it, if fsync is enabled, we *always* sync even if the file
didn't exist.

10 years agoostree_repo_checkout_tree_at: remove @subpath documentation
Giuseppe Scrivano [Mon, 13 Apr 2015 09:37:18 +0000 (11:37 +0200)]
ostree_repo_checkout_tree_at: remove @subpath documentation

It is not an argument of the function.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoAdd an API to set/unset a deployment tree's mutability
Colin Walters [Thu, 12 Feb 2015 14:13:30 +0000 (09:13 -0500)]
Add an API to set/unset a deployment tree's mutability

This will be used by rpm-ostree to unset the immutable bit temporarily
in order to do package layering.  We could add an API to deploy a tree
without the immutable bit, but this is simpler.

10 years agopull-metalink: Don't print error output when we expect failure
Colin Walters [Thu, 9 Apr 2015 13:14:52 +0000 (09:14 -0400)]
pull-metalink: Don't print error output when we expect failure

I think I added `cat err.txt` to debug, but it's not necessary now.

11 years agoadmin: Show GPG signatures in status command
Matthew Barnes [Tue, 31 Mar 2015 23:52:19 +0000 (19:52 -0400)]
admin: Show GPG signatures in status command

11 years agogpg: Add ostree_gpg_verify_result_describe()
Matthew Barnes [Fri, 20 Mar 2015 16:07:03 +0000 (12:07 -0400)]
gpg: Add ostree_gpg_verify_result_describe()

Internalizes the signature output of "ostree show" so it can be reused
elsewhere.

11 years agoRelease 2015.5
Colin Walters [Tue, 7 Apr 2015 20:18:45 +0000 (16:18 -0400)]
Release 2015.5

11 years agoostree_repo_checkout_tree_at: New API for checkouts
Colin Walters [Mon, 6 Apr 2015 22:29:01 +0000 (18:29 -0400)]
ostree_repo_checkout_tree_at: New API for checkouts

rpm-ostree currently uses ostree_repo_checkout_tree(), which as a side
effect will use the uncompressed objects cache by default.  This is
rather annoying if you're using rpm-ostree on a server-side
repository, because if you then rsync the repo, you'll be syncing out
the uncompressed objects unless you exclude them.

We added the ability to disable the uncompressed cache in the
repository config to fix this, but it's better to allow application
control over this.  The uncompressed cache will in some future version
become opt in as well.

This new API further:
 - Drops the `GFile` usage in favor of `openat` APIs
 - Improves ergonomics by avoiding callers having to query the source
   `GFileInfo` (and carry around a copy of `OSTREE_GIO_FAST_QUERYINFO`)
 - Has a more extensible options structure

Per the comment, I rather crudely have the `ostree checkout` builtin
call both APIs to ensure some testing coverage.

However, I'd like to in the future have easier-to-set-up testing code
that calls `libtest.sh` to set up dummy data.

11 years agopull: Handle remote web server not honoring range requests
Colin Walters [Sat, 4 Apr 2015 14:49:28 +0000 (10:49 -0400)]
pull: Handle remote web server not honoring range requests

It's valid for the remote server to say 200 OK and give us the entire
file instead of a 206 Partial Content, and in that case we should blow
away the previous cached data, rather than blindly appending to it and
thus creating multiple copies of the data inside the file.

This problem primarily occurs when we do have the complete file, and
we're interrupted, then try again, where the new process didn't record
the download was already complete.  We do a range request for bytes
past the end, and some web servers (e.g. Akamai) will return 200 OK
with the whole content again, rather than a 416 Requested Range Not
Satisfiable.

Thus we could also fix this by saner caching strategy - since we know
the file is complete, rename it again to $checksum.done or something
before it's processed.  (Or really, rework how we do caching more
intelligently in general).

This fixes the issue that interrupted pulls failed with such
webservers, although repeated attempts would eventually succeed
because we'd unlink files that failed to pull.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1207292

11 years agotests: Verify that the pull error was from interruption
Colin Walters [Mon, 6 Apr 2015 15:10:56 +0000 (11:10 -0400)]
tests: Verify that the pull error was from interruption

While working on https://github.com/GNOME/ostree/pull/84 I wanted to
verify that nothing else was going wrong.

11 years agocore: Actually allow none in ostree_parse_refspec()
Matthew Barnes [Mon, 6 Apr 2015 16:08:27 +0000 (12:08 -0400)]
core: Actually allow none in ostree_parse_refspec()

Both 'out_remote' and 'out_ref' parameters already have the (allow-none)
annotation but that wasn't actually true.

11 years agotests: Missing linker flags for test-rollsum
Daniel Svensson [Mon, 6 Apr 2015 14:25:03 +0000 (10:25 -0400)]
tests: Missing linker flags for test-rollsum

Reproducable on Debian; Fedora lets it slide.

11 years agodist-packaging: Don't delete 91-ostree.preset, do clean old rpms/sources
Colin Walters [Sun, 5 Apr 2015 13:18:42 +0000 (09:18 -0400)]
dist-packaging: Don't delete 91-ostree.preset, do clean old rpms/sources

We have to copy the sources to avoid rpmbuild deleting them.  But on
the other hand there's no reason for old sources to stick around.

11 years agotests: skip test-commit-sign.sh when not root
Giuseppe Scrivano [Thu, 2 Apr 2015 12:21:52 +0000 (14:21 +0200)]
tests: skip test-commit-sign.sh when not root

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agobuild: exclude .sig files from syntax-check
Giuseppe Scrivano [Thu, 2 Apr 2015 12:21:29 +0000 (14:21 +0200)]
build: exclude .sig files from syntax-check

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc/ostree/ot-main.c: drop empty newline at end of file
Giuseppe Scrivano [Thu, 2 Apr 2015 12:16:57 +0000 (14:16 +0200)]
src/ostree/ot-main.c: drop empty newline at end of file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests/basic-test.sh: enable repo-noperm test only for non-root user
Giuseppe Scrivano [Thu, 2 Apr 2015 12:09:33 +0000 (14:09 +0200)]
tests/basic-test.sh: enable repo-noperm test only for non-root user

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agobuild: Drop libattr from the spec file
Giuseppe Scrivano [Thu, 2 Apr 2015 08:16:31 +0000 (10:16 +0200)]
build: Drop libattr from the spec file

commit 534c4c20c3fa5ad9500ea96093a3ece7821a6056 already drops its
usage in the code.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agobuild: Use glibc's xattr support instead of requiring libattr
Daniel Svensson [Wed, 1 Apr 2015 07:45:20 +0000 (09:45 +0200)]
build: Use glibc's xattr support instead of requiring libattr

Fixes the build on Debian, and is one library less.

Closes: #78
11 years agomain: Only verify SUPERUSER flag if using default sysroot
Colin Walters [Wed, 1 Apr 2015 10:21:34 +0000 (06:21 -0400)]
main: Only verify SUPERUSER flag if using default sysroot

The use case for non-default sysroots that I know of are:
 1) The current test suite
 2) Installers (Anaconda)
 3) Inspecting VM disks

For 2) and 3), it'll quickly be obvious if they're not running as
root, and these are more obscure cases.  We want to allow 1), and this
is a simple way to do it.

https://bugzilla.gnome.org/show_bug.cgi?id=747164

11 years agoInclude ostree-gpg-verify-result.h in ostree.h
Matthew Barnes [Tue, 31 Mar 2015 23:48:55 +0000 (19:48 -0400)]
Include ostree-gpg-verify-result.h in ostree.h

11 years agocore: Fix possible crash in ostree_mutable_tree_walk()
Sam Thursfield [Tue, 31 Mar 2015 16:59:43 +0000 (12:59 -0400)]
core: Fix possible crash in ostree_mutable_tree_walk()

If the starting index is beyond the end of the list, it's a programming
error. Previously, the code was trying to raise a runtime error, but
actually causing a segfault.

This was detected by test code in test-mutable-tree.c, which is removed
in this commit because it should now not be possible to crash here.

https://bugzilla.gnome.org/747032

11 years agobsdiff: change submodule location
Giuseppe Scrivano [Thu, 26 Mar 2015 22:31:25 +0000 (23:31 +0100)]
bsdiff: change submodule location

The cleanup code was merged in the https://github.com/mendsley/bsdiff
repository, so just use it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoAdd OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER
Matthew Barnes [Sun, 22 Feb 2015 21:06:39 +0000 (16:06 -0500)]
Add OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER

Indicates the command requires superuser privilege.  Fails early with
a more helpful message than would otherwise be returned by libostree.

Currently all admin commands except 'status' require superuser.

11 years agoAdd OstreeAdminBuiltinFlags for admin commands
Matthew Barnes [Sun, 22 Feb 2015 20:41:02 +0000 (15:41 -0500)]
Add OstreeAdminBuiltinFlags for admin commands

Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.

11 years agotests: Add a test case for unwritable repos
Matthew Barnes [Wed, 4 Feb 2015 02:44:38 +0000 (21:44 -0500)]
tests: Add a test case for unwritable repos

11 years agoCheck repo permission prior to attempting to modify it
Matthew Barnes [Fri, 16 Jan 2015 18:28:36 +0000 (13:28 -0500)]
Check repo permission prior to attempting to modify it

Fail early with a helpful message if the user does not have sufficient
permission to modify an OSTree repository.

11 years agoAdd ostree_ensure_repo_writable()
Matthew Barnes [Fri, 16 Jan 2015 15:04:18 +0000 (10:04 -0500)]
Add ostree_ensure_repo_writable()

Commands that need to write files within the repo directory can call
this early to ensure the directory is writable for the current user.
If not, it fails with a helpful "You need to be root to perform this
command" message.

11 years agoAdd ostree_repo_is_writable()
Matthew Barnes [Mon, 19 Jan 2015 01:27:53 +0000 (20:27 -0500)]
Add ostree_repo_is_writable()

11 years agoRelease 2015.4
Colin Walters [Wed, 25 Mar 2015 16:50:50 +0000 (12:50 -0400)]
Release 2015.4

11 years agogpg-sign: Add missing NULL terminator in options
Colin Walters [Tue, 24 Mar 2015 13:57:27 +0000 (09:57 -0400)]
gpg-sign: Add missing NULL terminator in options

11 years agoFix build with !HAVE_LIBSOUP
Alexander Larsson [Mon, 23 Mar 2015 13:17:52 +0000 (14:17 +0100)]
Fix build with !HAVE_LIBSOUP

Fix up ostree_repo_pull to match the new declaration

11 years agogpg-sign: Update man page for --delete option
Matthew Barnes [Fri, 20 Mar 2015 16:57:20 +0000 (12:57 -0400)]
gpg-sign: Update man page for --delete option

11 years agolibglnx: Update to latest
Colin Walters [Fri, 20 Mar 2015 14:56:45 +0000 (10:56 -0400)]
libglnx: Update to latest

Just on general principle.  Newer is better.

11 years agobuild: ostree-gpg-verify-result.h is a public header, install it
Colin Walters [Fri, 20 Mar 2015 14:55:56 +0000 (10:55 -0400)]
build: ostree-gpg-verify-result.h is a public header, install it

11 years agoFix build failure on g_autoptr(gchar) with glib master
Alexander Larsson [Fri, 20 Mar 2015 14:36:56 +0000 (15:36 +0100)]
Fix build failure on g_autoptr(gchar) with glib master

This was removed in favour of g_autofree

11 years agogpg: Regenerate test data for test-gpg-verify-result
Matthew Barnes [Thu, 19 Mar 2015 16:43:04 +0000 (12:43 -0400)]
gpg: Regenerate test data for test-gpg-verify-result

Turns out the expired signature case was failing because the signature
itself was corrupted.  Reconstructed the test data and updated the test
code.  Note, an expired signature is still counted as valid.

Also, handy debugging trick for setting a key or signature expiry: the
CLI makes it appear the shortest expiry is 1 day, but it also secretly
recognizes "seconds=N".

11 years agogpg: Link to GPGME bug about GPGME_SIGSUM_KEY_REVOKED
Matthew Barnes [Thu, 19 Mar 2015 14:21:08 +0000 (10:21 -0400)]
gpg: Link to GPGME bug about GPGME_SIGSUM_KEY_REVOKED

11 years agotests: Update test-gpg-signed-commit.sh
Matthew Barnes [Tue, 17 Mar 2015 15:22:27 +0000 (11:22 -0400)]
tests: Update test-gpg-signed-commit.sh

Utilize and test new CLI capabilities:

  - Signature count in 'ostree show' result
  - Duplicate signatures now rejected
  - Ability to delete signatures

11 years agoshow: Print a blurb for each signature on a commit
Matthew Barnes [Sun, 15 Mar 2015 19:41:03 +0000 (15:41 -0400)]
show: Print a blurb for each signature on a commit

Roughly mimics the output of "gpg --verify".

11 years agogpg-sign: Add a --delete option to delete signatures
Matthew Barnes [Thu, 12 Mar 2015 23:01:44 +0000 (19:01 -0400)]
gpg-sign: Add a --delete option to delete signatures

11 years agorepo: Reject duplicate signatures when signing commit
Matthew Barnes [Thu, 12 Mar 2015 23:00:51 +0000 (19:00 -0400)]
repo: Reject duplicate signatures when signing commit

Uses OstreeGpgVerifyResult to catch duplicate signatures.

If the commit has already been signed with the given GPG key ID, fail
with a G_IO_ERROR_EXISTS error code.

11 years agorepo: Add ostree_repo_verify_commit_ext()
Matthew Barnes [Wed, 11 Mar 2015 23:21:33 +0000 (19:21 -0400)]
repo: Add ostree_repo_verify_commit_ext()

Similar to ostree_repo_verify_commit(), but returns more verification
details by way of an OstreeGpgVerifyResult object instead of a boolean.

11 years agogpg: Add OstreeGpgVerifyResult
Matthew Barnes [Wed, 4 Mar 2015 17:44:47 +0000 (12:44 -0500)]
gpg: Add OstreeGpgVerifyResult

Wrappers a referenced gpgme_verify_result_t so detailed verify results
can be examined independently of executing a verify operation.

_ostree_gpg_verifier_check_signature() now returns this object instead
of a single valid/invalid boolean, but the idea is for OstreeRepo to also
return this object for commit signature verification so it can be utilized
at the CLI layer (and possibly by other programs).

11 years agofsck: Fix object count output
Dan Nicholson [Tue, 17 Mar 2015 19:20:53 +0000 (12:20 -0700)]
fsck: Fix object count output

The object count comes from g_hash_table_size(), so it's not a 0 based
index. In order to maintain the mod calculations correctly, just print
out index + 1.

https://bugzilla.gnome.org/show_bug.cgi?id=746360

11 years agoOstreeGpgVerifier: Take the signed data as a GBytes
Matthew Barnes [Mon, 16 Mar 2015 17:01:55 +0000 (13:01 -0400)]
OstreeGpgVerifier: Take the signed data as a GBytes

Similar to c2b01ad.  For some reason I was thinking the commit data
still needed to be written to disk prior to verifying, but it's just
another artifact of spawning gpgv2 (predates using GPGME).

Makes for a nice cleanup in fetch_metadata_to_verify_delta_superblock()
as well.

11 years agoOstreeGpgVerifier: Don't add trustdb.gpg to the keyring list
Matthew Barnes [Mon, 16 Mar 2015 13:54:24 +0000 (09:54 -0400)]
OstreeGpgVerifier: Don't add trustdb.gpg to the keyring list

In case someone like me is mucking around in $OSTREE_GPG_HOME and
accidentally creates a trust database there.

11 years agoostree-repo.c: fix typo
Giuseppe Scrivano [Mon, 16 Mar 2015 10:27:19 +0000 (11:27 +0100)]
ostree-repo.c: fix typo

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agorepo: Delete .commitmeta file on empty metadata
Matthew Barnes [Fri, 13 Mar 2015 01:17:34 +0000 (21:17 -0400)]
repo: Delete .commitmeta file on empty metadata

The API docs for ostree_repo_write_commit_detached_metadata() were
written as though it already behaved that way.

https://bugzilla.gnome.org/746123

11 years agobuild: Use both pkg-config and AM_PATH_GPGME
Colin Walters [Wed, 11 Mar 2015 19:58:42 +0000 (15:58 -0400)]
build: Use both pkg-config and AM_PATH_GPGME

Apparently OpenEmbeddeded only supports pkg-config (and includes
gpgme.pc in its content), and Fedora only has the latter.  So do both.

11 years agoconfigure.ac: Make gpgme a hard dependency
Matthew Barnes [Wed, 11 Mar 2015 15:34:59 +0000 (11:34 -0400)]
configure.ac: Make gpgme a hard dependency

In anticipation of API enhancements for GPG signature verification, which
would otherwise require a non-functional stub version were GPGME excluded.

GPGME is a pretty lightweight dependency, and the motivation to exclude
it is not clear.

11 years agoREADME.md: Note make check
Colin Walters [Wed, 11 Mar 2015 01:51:20 +0000 (21:51 -0400)]
README.md: Note make check

11 years agosysroot: Port some deployment reading code to fd-relative APIs
Colin Walters [Tue, 10 Mar 2015 13:07:59 +0000 (09:07 -0400)]
sysroot: Port some deployment reading code to fd-relative APIs

More low hanging fruit in the sysroot department.

11 years agodeployment: Add an API to get relative origin path
Colin Walters [Tue, 10 Mar 2015 13:07:12 +0000 (09:07 -0400)]
deployment: Add an API to get relative origin path

This will be used for fd-relative cleanups.

11 years agosysroot: Drop unnecessary new sysroot object
Colin Walters [Tue, 10 Mar 2015 12:41:04 +0000 (08:41 -0400)]
sysroot: Drop unnecessary new sysroot object

We're asserting that "/" is the same as our path, so we don't need to
make a new object.

11 years agoostree-prepare-root: log informational messages to stdout
Daniel Drake [Mon, 9 Mar 2015 18:20:18 +0000 (12:20 -0600)]
ostree-prepare-root: log informational messages to stdout

ostree-prepare-root was logging normal, informational messages
to stderr which the systemd unit points to the console.

To achieve silent boot, log these ordinary messages to stdout only.

11 years agoglnx: Update
Colin Walters [Tue, 10 Mar 2015 01:21:47 +0000 (21:21 -0400)]
glnx: Update

11 years agosysroot: Make origin parsing code fd-relative
Colin Walters [Thu, 5 Mar 2015 23:42:22 +0000 (18:42 -0500)]
sysroot: Make origin parsing code fd-relative

Just more API conversion.

11 years agosysroot: Read the bootloader configuration with fd-relative API
Colin Walters [Thu, 5 Mar 2015 02:33:25 +0000 (21:33 -0500)]
sysroot: Read the bootloader configuration with fd-relative API

Another piece of the conversion.

11 years agosysroot: Read some bootloader state with fd-relative API
Colin Walters [Thu, 5 Mar 2015 02:03:25 +0000 (21:03 -0500)]
sysroot: Read some bootloader state with fd-relative API

This is the start of migrating the deployment path to fd-relative
code.

11 years agotests: Add tests for test-ot-tool-util
Giuseppe Scrivano [Fri, 6 Mar 2015 11:54:53 +0000 (12:54 +0100)]
tests: Add tests for test-ot-tool-util

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: Drop unused argument "value" from ot_parse_boolean
Giuseppe Scrivano [Fri, 6 Mar 2015 11:53:43 +0000 (12:53 +0100)]
src: Drop unused argument "value" from ot_parse_boolean

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: Move ot-tool-util from ostree/ to libotutil/
Giuseppe Scrivano [Fri, 6 Mar 2015 11:21:07 +0000 (12:21 +0100)]
src: Move ot-tool-util from ostree/ to libotutil/

These utilities are not actually specific to the ostree commandline.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agolibotutil: remove ot-waitable-queue.
Giuseppe Scrivano [Fri, 6 Mar 2015 10:48:24 +0000 (11:48 +0100)]
libotutil: remove ot-waitable-queue.

The module is not not used anymore.  It can be restored from git if
needed again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: add test for test-ot-opt-utils.
Giuseppe Scrivano [Fri, 6 Mar 2015 10:38:13 +0000 (11:38 +0100)]
tests: add test for test-ot-opt-utils.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agokeyfile-utils: add tests
Giuseppe Scrivano [Thu, 5 Mar 2015 14:40:52 +0000 (15:40 +0100)]
keyfile-utils: add tests

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoot_keyfile_copy_group: return FALSE on invalid inputs
Giuseppe Scrivano [Thu, 5 Mar 2015 13:40:00 +0000 (14:40 +0100)]
ot_keyfile_copy_group: return FALSE on invalid inputs

The function returns a gboolean, replace g_return_if_fail with
g_return_val_if_fail.

Add similar checks to the other functions.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoostree-repo-refs: Drop unused function "parse_rev_file".
Giuseppe Scrivano [Thu, 5 Mar 2015 11:18:30 +0000 (12:18 +0100)]
ostree-repo-refs: Drop unused function "parse_rev_file".

If it will be needed in future, it can be retrieved from the git
history.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: drop some dead assignments
Giuseppe Scrivano [Thu, 5 Mar 2015 10:57:41 +0000 (11:57 +0100)]
src: drop some dead assignments

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoOstreeGpgVerifier: Take the signature as a GBytes
Matthew Barnes [Tue, 3 Mar 2015 19:15:27 +0000 (14:15 -0500)]
OstreeGpgVerifier: Take the signature as a GBytes

The signature data is in memory to begin with, so there's no need to
write it to disk only to immediately read it back.

Also, because the GPGME multi-keyring workaround is somewhat expensive
to setup and teardown, concatenate all signatures into a single GBytes
so _ostree_gpg_verifier_check_signature() is only called once.  We're
currently only looking for one valid signature anyway.

11 years agogpg: Rewrite OstreeGpgVerifier to use GPGME
Matthew Barnes [Mon, 2 Mar 2015 16:16:16 +0000 (11:16 -0500)]
gpg: Rewrite OstreeGpgVerifier to use GPGME

This sets the stage for more advanced signature management.

(Also, talking to GPG over pipes sucks.)

Previously we were spawning gpgv2 with a bunch of --keyring options
for /usr/share/ostree/trusted.gpg.d/ and whatever other keyring files
were explicitly added.  GPGME has no public API for multiple keyrings,
so we work around the issue by setting up a temp directory to serve as
a fake "home" directory for the crypto engine and then concatenate all
the keyring files into a single public keyring (pubring.gpg).

Unfortunately at present we do this on every signature verification.
There's a desire to cache this concatenation, but the problem is the
user may be unprivileged.  So it seems the cache would have to be per
user under $XDG_CACHE_HOME, which OSTree doesn't otherwise use.  I'm
open to suggestions.

We do at least clean up the temp directory when finished, and I have
further API changes planned to OstreeGpgVerifier to help mitigate the
performance impact.

11 years agotests: add tests for mutable tree.
Giuseppe Scrivano [Wed, 4 Mar 2015 13:14:18 +0000 (14:14 +0100)]
tests: add tests for mutable tree.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agorepo: Fix assertion to allow NULL options
Colin Walters [Wed, 4 Mar 2015 02:18:40 +0000 (21:18 -0500)]
repo: Fix assertion to allow NULL options

Spotted by Adam Coldrick.

11 years agocommit: Add missing (allow-none) in write_ref_immediate()
Colin Walters [Wed, 4 Mar 2015 02:16:33 +0000 (21:16 -0500)]
commit: Add missing (allow-none) in write_ref_immediate()

Spotted by Adam Coldrick.

11 years agodeltas: Use mmap() instead of copying input file
Colin Walters [Tue, 3 Mar 2015 23:39:45 +0000 (18:39 -0500)]
deltas: Use mmap() instead of copying input file

It's more efficient.

11 years agodeltas: Gather statistics on total number rollsum'd and bsdiff'd
Colin Walters [Tue, 3 Mar 2015 22:48:37 +0000 (17:48 -0500)]
deltas: Gather statistics on total number rollsum'd and bsdiff'd

Useful for debugging at least.  Though in the future it'd be nice to
store this inside the delta metadata maybe?

11 years agotests: Remove some duplications from Makefile-tests.am
Giuseppe Scrivano [Tue, 3 Mar 2015 13:21:40 +0000 (14:21 +0100)]
tests: Remove some duplications from Makefile-tests.am

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: enforce ${CMD_PREFIX} on all ostree processes
Giuseppe Scrivano [Tue, 3 Mar 2015 12:13:54 +0000 (13:13 +0100)]
tests: enforce ${CMD_PREFIX} on all ostree processes

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>